package cn.mawenda.docker.service.impl;

import org.springframework.beans.factory.annotation.Value;
import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.core.DockerClientBuilder;
import org.springframework.stereotype.Component;


/**
 * @Author: Ma.wenda
 * @Date: 2024-05-16 15:28
 * @Version: 1.0
 **/
@Component
public class DockerService {

    @Value("${docker.host}")
    private String dockerHost;

    /**
     * 获取docker客户端
     * @return
     */
    public DockerClient dockerClient() {

        return DockerClientBuilder.getInstance(dockerHost).build();
    }
}
